home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 303_01.zip / CONV.C < prev    next >
Text File  |  1993-04-01  |  753b  |  42 lines

  1. #include <stdio.h>
  2. #include <a.out.h>
  3. #include <ldfcn.h>
  4. #include "unc.h"
  5.  
  6. unsigned convtosun(sym)
  7. struct syment *sym;
  8. {
  9.     unsigned suntype;
  10.  
  11.     /*    everything in shlib is an external constant    */
  12.     if (sym->n_value >= 0x300000) {
  13.     sym->n_scnum = N_ABS;
  14.          sym->n_sclass = C_EXT;
  15.     }
  16.     switch(sym->n_scnum) {
  17.     case N_UNDEF:
  18.     case N_DEBUG:    /* call things that don't map well "undefined" */
  19.     case N_TV:
  20.     case P_TV:
  21.     suntype = S_UNDF;
  22.     break;
  23.     case N_ABS:
  24.     suntype = S_ABS;
  25.     break;
  26.     case 1:
  27.     suntype = S_TEXT;
  28.     break;
  29.     case 2:
  30.     suntype = S_DATA;
  31.     break;
  32.     case 3:
  33.     suntype = S_BSS;
  34.     break;
  35.     }
  36.  
  37.     if (sym->n_sclass == C_EXT)
  38.     suntype = suntype | S_EXT;
  39.  
  40.     return(suntype);
  41. }
  42.